4  Appendix A

4.1 Setup

4.1.1 Install Packages

We install the following packages using the groundhog package manager to increase computational reproducibility.

options(repos = c(CRAN = "https://cran.r-project.org")) 

if (!requireNamespace("groundhog", quietly = TRUE)) {
  install.packages("groundhog")
}

pkgs <- c("magrittr", "data.table", "stringr", "Rmisc", "gt")

groundhog::groundhog.library(pkg = pkgs,
                             date = "2024-08-01")

rm(pkgs)

4.1.2 Read Data

data      <- readRDS(file="../data/processed/full.Rda")
vars <- str_subset(string = names(data), pattern = "^.{1,4}$", negate = TRUE)
covariates <- data[stage == 1, ..vars]

4.2 Table A.1

long_df <- melt(covariates, 
                id.vars = c("surprise", "communication"), 
                measure.vars = c("age_18_34", "age_35_52", "age_53_plus", "female", 
                                 "high_education", "high_income", "married", "parentship", 
                                 "high_temperature", "high_usage", "high_general_risk", 
                                 "high_weather_risk", "high_accuracy", "high_credibility",
                                 "temperature", "usage", "general_risk", 
                                 "weather_risk", "accuracy", "credibility"),
                variable.name = "Variable", 
                value.name = "Value")

pooled_summary <- long_df[, .(N = sum(!is.na(Value)),
                              Mean = mean(Value, na.rm = TRUE)), 
                          by = .(Variable)]

summary_tmp <- long_df[, .(N = sum(!is.na(Value)),
                             Mean = mean(Value, na.rm = TRUE)), 
                         by = .(surprise, communication, Variable)]

summary_table <- merge(pooled_summary, summary_tmp, by = "Variable", suffixes = c("_pooled", ""))


summary_table_wide <- dcast(summary_table, Variable + N_pooled + Mean_pooled ~ surprise + communication, 
                            value.var = c("N", "Mean"))

setcolorder(summary_table_wide, 
            c("Variable", "N_pooled", "Mean_pooled", 
              "N_FALSE_point", "Mean_FALSE_point", 
              "N_FALSE_interval", "Mean_FALSE_interval", 
              "N_FALSE_both", "Mean_FALSE_both", 
              "N_TRUE_point", "Mean_TRUE_point", 
              "N_TRUE_interval", "Mean_TRUE_interval", 
              "N_TRUE_both", "Mean_TRUE_both"))

summary_table_wide %>%
  gt() %>%
  cols_label(
    Variable = "Treatment Variable",
    N_pooled = "N", Mean_pooled = "Mean",
    N_TRUE_point = "N", Mean_TRUE_point = "Mean",
    N_TRUE_interval = "N", Mean_TRUE_interval = "Mean",
    N_TRUE_both = "N", Mean_TRUE_both = "Mean",
    N_FALSE_point = "N", Mean_FALSE_point = "Mean",
    N_FALSE_interval = "N", Mean_FALSE_interval = "Mean",
    N_FALSE_both = "N", Mean_FALSE_both = "Mean") %>%
  tab_spanner(
    label = "Pooled",
    columns = c(N_pooled, Mean_pooled)) %>%
  tab_spanner(
    label = "Point",
    columns = c(N_TRUE_point, Mean_TRUE_point, N_FALSE_point, Mean_FALSE_point)) %>%
  tab_spanner(
    label = "Interval",
    columns = c(N_TRUE_interval, Mean_TRUE_interval, N_FALSE_interval, Mean_FALSE_interval)) %>%
  tab_spanner(
    label = "Point + Interval",
    columns = c(N_TRUE_both, Mean_TRUE_both, N_FALSE_both, Mean_FALSE_both)) %>%
  tab_spanner(
    label = "Confirmation",
    columns = c(N_FALSE_point, Mean_FALSE_point, N_FALSE_interval, Mean_FALSE_interval, N_FALSE_both, Mean_FALSE_both)) %>%
  tab_spanner(
    label = "Contradiction",
    columns = c(N_TRUE_point, Mean_TRUE_point, N_TRUE_interval, Mean_TRUE_interval, N_TRUE_both, Mean_TRUE_both)) %>%
  fmt_number(
    columns = starts_with("Mean"),
    decimals = 3) %>%
  fmt_number(
    columns = starts_with("N"),
    decimals = 0) %>%
  cols_align(
    align = "left",
    columns = c(Variable)
  )
Table 4.1: Descriptive statistics (control variables): Mean values per treatment
Contradiction Confirmation Contradiction Confirmation Contradiction Confirmation
Treatment Variable Pooled Point Interval Point + Interval
N Mean N Mean N Mean N Mean N Mean N Mean N Mean
age_18_34 1,503 0.335 251 0.386 255 0.325 258 0.345 243 0.309 249 0.345 247 0.296
age_35_52 1,503 0.306 251 0.299 255 0.310 258 0.302 243 0.313 249 0.313 247 0.300
age_53_plus 1,503 0.359 251 0.315 255 0.365 258 0.353 243 0.379 249 0.341 247 0.405
female 1,505 0.490 252 0.540 255 0.463 258 0.484 243 0.444 250 0.528 247 0.478
high_education 1,505 0.618 252 0.643 255 0.616 258 0.578 243 0.687 250 0.612 247 0.575
high_income 1,363 0.525 225 0.547 230 0.552 234 0.517 220 0.564 227 0.471 227 0.498
married 1,505 0.396 252 0.389 255 0.427 258 0.403 243 0.379 250 0.356 247 0.421
parentship 1,505 0.429 252 0.440 255 0.400 258 0.450 243 0.395 250 0.404 247 0.482
high_temperature 1,505 0.591 252 0.575 255 0.557 258 0.589 243 0.613 250 0.668 247 0.543
high_usage 1,505 0.511 252 0.548 255 0.518 258 0.465 243 0.494 250 0.516 247 0.526
high_general_risk 1,505 0.540 252 0.512 255 0.561 258 0.589 243 0.506 250 0.552 247 0.514
high_weather_risk 1,505 0.633 252 0.679 255 0.600 258 0.678 243 0.588 250 0.660 247 0.587
high_accuracy 1,505 0.786 252 0.698 255 0.800 258 0.756 243 0.819 250 0.836 247 0.810
high_credibility 1,505 0.503 252 0.369 255 0.490 258 0.484 243 0.560 250 0.504 247 0.615
temperature 1,505 20.051 252 20.079 255 19.906 258 20.062 243 20.267 250 20.468 247 19.526
usage 1,505 3.347 252 3.393 255 3.408 258 3.275 243 3.350 250 3.308 247 3.348
general_risk 1,505 4.193 252 4.048 255 4.290 258 4.407 243 4.012 250 4.396 247 3.988
weather_risk 1,505 5.260 252 5.433 255 5.122 258 5.585 243 4.967 250 5.496 247 4.935
accuracy 1,505 2.241 252 1.992 255 2.306 258 2.081 243 2.366 250 2.308 247 2.405
credibility 1,505 2.378 252 2.056 255 2.380 258 2.380 243 2.498 250 2.404 247 2.559